#ifndef ARRAYLIST_H
#define ARRAYLIST_H

#define INITIAL_CAPACITY 	100
// the heritage of the template class (see the cvs)
typedef int T;

class ArrayList
{
public:
    ArrayList();
    ArrayList(int initialCapacity);
    void insert(T value, int where);
    void add(T value);
    T get(int index);
    int indexOf(T value);
    T deleteElement(int index);
    void deleteAll();
    int deleteElementWithValue(T value);    
    int size();
    bool isEmpty();
    // iterator-like elements:
    void startPos();
    bool isAtEnd();
    T getNext();


    ~ArrayList();
protected:
    // own methods:
    void clear();
    void ensureCapacity(int capacity);
    bool isOutOfBounds(int index);

protected:
    T* _values; ///! Stores values of the list
    int _nSize; ///! the size of values
    int _nInitialCapacity; ///! the value used to reallocate the array
    int _nCur;
};

#endif // ARRAYLIST_H
